#include<iostream>
#include<cmath>
using namespace std;
int n=10000; 
double fun1(double x)
{
	4/(1+x*x);
}
double integral(int a,int b,double(*p)(double x))
{
	double h,t1,t2=0,tn;
	h=(b-a)/n;
	t1=((*p)(a)*(*p)(b))*h/2;
	for(int i=1;i<n-1;i++)
	{
		t2=t2+h*(*p)(a+i*h);
	}
	tn=t1+t2;
	cout<<tn<<endl;
}
int mian()
{
	integral(0,1,fun1);
	return 0;
} 
